package org.helios.gwt.remote.sample.client.shared;

import org.helios.gwt.remote.client.Importer;

import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;

public class PortalUtil 
{
	public static final PortalHandle getPortal()
	{
		PortalHandleImporter importer = GWT.create(PortalHandleImporter.class);
		PortalHandle handle = importer.use(getPortalHandleJSO());
		return handle;
	}
	
	private static native JavaScriptObject getPortalHandleJSO() /*-{
		return $wnd.__portal_global_entry;
	}-*/;
	
	interface PortalHandleImporter extends Importer<PortalHandle> {}
}
